<?php
/**
 * Created by PhpStorm.
 * User: lance
 * Date: 11/27/17
 * Time: 5:09 PM
 */

/**
 * 客户分组表
 */

namespace app\customer\admin;


use app\admin\controller\Admin;
use app\common\builder\ZBuilder;
use think\Db;

class level extends Admin
{
    /**
     * 分组列表
     */
    public function levelList()
    {
        $a_where = [];
        $o_dataList = Db::name('customer_level')->where($a_where)->select();
        return ZBuilder::make('table')
            ->hideCheckbox()
            ->addColumns([
                ['id', 'ID'],
                ['name', '分组名','text.edit'],
                ['status','开启状态','switch'],
            ])
            ->addValidate('Level','name')
            ->autoAdd([
                ['text', 'name', '分组名', '必填']
            ], '', true)
            ->setRowList($o_dataList)
            ->fetch();
    }
}